import { computed } from "vue";

export function buildStyles(fn: any) {
    return computed<any>(fn);
}

export function getColor(value: string | undefined) {
    if (value === undefined) {
        return "";
    }
    if (value.indexOf("#") !== -1) {
        return value;
    }
    switch (value) {
        case "primary":
            return "var(--primary-color)";
        case "secondary":
            return "var(--secondary-color)";
        case "gray":
            return "var(--color-gray)";
    }
    return "";
}

export function getSize(value?: string | number) {
    if (value === undefined) {
        return "";
    }
    if (typeof value === "number") {
        return value + "px";
    }
    return value;
}